<%@ page import="driver.service.UserServiceImpl_u" %>
<%@ page import="driver.entity.User" %><%--
  Created by IntelliJ IDEA.
  User: LSK
  Date: 2019/10/30
  Time: 11:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn" lang="zh-cn">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>个人电子凭证</title>
    <meta name="author" content="HP" />
    <style type="text/css">
        body {
            background: #fff;
            height: 2000px;
        }

        * {
            margin: 0;
            padding: 0;
            text-indent: 0;
        }

        h1 {
            color: black;
            font-family: 宋体;
            font-style: normal;
            font-weight: bold;
            text-decoration: none;
            /*font-size: 22pt;*/
            font-size: 28pt;
        }

        .s1 {
            color: black;
            font-family: 宋体;
            font-style: normal;
            font-weight: normal;
            text-decoration: none;
            /*font-size: 10.5pt;*/
            font-size: 16pt;
        }

        .s2 {
            color: black;
            font-family: 宋体;
            font-style: normal;
            font-weight: normal;
            text-decoration: none;
            text-align: center;
            font-size: 11pt;
        }

        .s3 {
            color: black;
            font-family: 宋体;
            font-style: normal;
            font-weight: bold;
            text-decoration: none;
            /*font-size: 9pt;*/
            font-size: 14pt;
        }

        .s4 {
            color: black;
            font-family: 宋体;
            font-style: normal;
            font-weight: normal;
            text-decoration: none;
            font-size: 14pt;
            line-height: 26pt;
            text-align: center;
        }

        .p,
        p {
            color: black;
            font-family: 宋体;
            font-style: normal;
            font-weight: normal;
            text-decoration: none;
            /*font-size: 9pt;*/
            font-size: 14pt;
            margin: 0pt;
        }

        p{
            line-height: 46px;
        }
        .s5 {
            color: black;
            font-family: 宋体;
            font-style: normal;
            font-weight: normal;
            text-decoration: none;
            /*font-size: 12pt;*/
            font-size: 20pt;
        }

        .a,
        a {
            color: black;
            font-family: 宋体;
            font-style: normal;
            font-weight: normal;
            text-decoration: none;
            /*font-size: 9pt;*/
            font-size: 14pt;
        }



        body {
            margin: 0;
        }

        .content {
            width: 820px;
            margin: 0 auto;
            line-height: 2;
            width: 70%;
        }

        #renderPdf,.aTop {
            display: block;
            width: 120px;
            height: 24px;
            color: #fff;
            background: rgb(96, 204, 81);
            border: none;
            border-radius: 4px;
            border: 1px solid rgb(97, 194, 97);
            box-shadow: 2px 2px 15px 1px #ccc;
            cursor: pointer;
            transition: all 0.4s ease;
            margin: 0 auto;
            font-size: 9pt;
        }

        .aTop:hover{
            opacity: 0.84;
            color: black;
        }
        #renderPdf{
            width: 130px;
            margin:40px 0 0 3vw;
        }

        #renderPdf:hover {
            color: black;
            opacity: 0.84;
            transform: translateY(-4px);
        }

        #Footer {
            width: 100%;
            text-align: center;
            transition: all 1s ease;
        }
    </style>
</head>

<body>
<%
    String uid=request.getParameter("uid");
    System.out.println(uid);
    UserServiceImpl_u service=new UserServiceImpl_u();
    User user = service.select_user_info(uid);
    System.out.println(user);
    pageContext.setAttribute("user",user);
%>
<div class="content">
    <button id="renderPdf" style="display: block">导出为PDF</button>
    <br>
    <hr> <br>
    <h1 style="text-indent: 0pt;line-height: 22pt;text-align:center;">
        中国大地财产保险股份有限公司
    </h1>
    <p class="s1" style="padding-top: 1pt;text-indent: 0pt;text-align: center;">驾考无忧-电子凭证</p>
    <p style="text-indent: 0pt;text-align: left;"><br /></p>
    <p class="s2" style="padding-left: 11pt;text-indent: 0pt;text-align: left;">本公司依据投保人申请，按以下条件承保：大地驾考无忧险
        以下信息来源于您的投保申请，是为您提供理赔服务及售后服务的重要依据，请务必仔细核对。如有错误或遗漏请立刻拨打95590申请修改。</p>
    <p style="font-size:11pt;text-align: right" >保单号:${user.policyid}</p>
    <p style="text-indent: 0pt;text-align: left;"><br /></p>
    <!-- -left:11.36pt -->
    <table style="border-collapse:collapse;margin:0 auto;" cellspacing="0">
        <tr style="height:17pt">
            <td
                    style="width:81pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s3" style="text-indent: 0pt;text-align: center;">产品名称
                </p>
            </td>
            <td style="width:451pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                colspan="6">
                <p class="s4" style="padding-top: 1pt;padding-left: 4pt;text-indent: 0pt;text-align: center;">
                    大地驾考无忧险</p>
            </td>
        </tr>
        <tr style="height:27pt">
            <td style="width:81pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                rowspan="2">
                <p style="text-indent: 0pt;text-align: left;"><br /></p>
                <p class="s3" style="text-indent: 0pt;text-align: center;">被保人信息</p>
            </td>
            <td
                    style="width:61pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s4" style="text-indent: 0pt;text-align: center; text-align: center;">姓名</p>
            </td>
            <td
                    style="width:120pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s4" style="padding-left: 1pt;text-indent: 0pt;text-align: center;">证件号</p>
            </td>
            <td
                    style="width:57pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s4" style="text-indent: 0pt;text-align: center;">方案名称</p>
            </td>
            <td
                    style="width:39pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s4"
                   style="text-indent: 0pt;line-height: 17pt;font-size:12px;text-align: center;">
                    受益人类型</p>
            </td>
            <td
                    style="width:45pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s4"
                   style="text-indent: 0pt;line-height: 17pt;font-size:12px;text-align: center;">
                    受益人姓名</p>
            </td>
            <td
                    style="width:129pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s4" style="text-indent: 0pt;text-align: center;">其他信息</p>
            </td>
        </tr>
        <tr style="height:33pt">
            <td
                    style="width:61pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s4"
                   style="padding-top: 2pt;padding-left: 4pt;padding-right: 7pt;text-indent: 0pt;line-height: 12pt;text-align: center;">
                    ${user.name}</p>
            </td>
            <td
                    style="width:120pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s4"
                   style="padding-top: 2pt;padding-left: 4pt;padding-right: 7pt;text-indent: 0pt;line-height: 12pt;text-align: center;">
                    ${user.idcardnum}</p>
            </td>
            <td
                    style="width:57pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s4"
                   style="padding-top: 2pt;padding-left: 4pt;padding-right: 7pt;text-indent: 0pt;line-height: 12pt;text-align: center;">
                    ${user.policyprod}</p>
            </td>
            <td
                    style="width:39pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s4" style="padding-top: 6pt;padding-left: 9pt;text-indent: 0pt;text-align: left;">法定</p>
            </td>
            <td
                    style="width:45pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s4" style="padding-top: 6pt;padding-left: 13pt;text-indent: 0pt;text-align: left;">法定</p>
            </td>
            <td
                    style="width:129pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s4"
                   style="padding-top: 2pt;padding-left: 35pt;padding-right: 3pt;text-indent: -31pt;line-height: 22pt;">
                    职业代码：机关内勤(不从事凶险工作);</p>
            </td>
        </tr>
        <tr style="height:16pt">
            <td
                    style="width:81pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s3" style="text-indent: 0pt;text-align: center;">保险期限
                </p>
            </td>
            <td style="width:451pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                colspan="6">
                <p class="s4"
                   style="padding-top: 2pt;padding-left: 35pt;padding-right: 3pt;text-indent: -31pt;line-height: 11pt;text-align: center;">
                    自${user.starttime} 00:00起至${user.endtime} 24:00止
                </p>
            </td>
        </tr>
        <tr style="height:17pt">
            <td
                    style="width:81pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s3" style="text-indent: 0pt;text-align: center;">争议解决方式
                </p>
            </td>
            <td style="width:451pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                colspan="6">
                <p class="s4" style="padding-top: 1pt;text-indent: 0pt;text-align: center;">诉讼</p>
            </td>
        </tr>
        <tr style="height:17pt">
            <td
                    style="width:81pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s3" style="text-indent: 0pt;text-align: center;">方案名称</p>
            </td>
            <td style="width:451pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                colspan="6">
                <p class="s4" style="text-indent: 0pt;text-align: center;">
                    ${user.policyprod}</p>
            </td>
        </tr>
        <tr style="height:17pt">
            <td style="width:185pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                colspan="3">
                <p class="s3" style="padding-top: 1pt;text-indent: 0pt;text-align: center;">保险责任</p>
            </td>
            <td
                    style="width:77pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s3" style="padding-top: 1pt;text-indent: 0pt;text-align: center;">保额</p>
            </td>
            <td
                    style="width:57pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p class="s3" style="padding-top: 1pt;padding-left: 18pt;text-indent: 0pt;text-align: left;">保险期限
                </p>
            </td>
            <td style="width:213pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                colspan="2">
                <p class="s3" style="padding-top: 1pt;text-indent: 0pt;text-align: center;">赔偿说明</p>
            </td>
        </tr>
        <tr style="height:17pt">
            <td style="width:81pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                rowspan="4">
                <p style="text-indent: 0pt;text-align: left;"><br /></p>
                <p class="s4" style="text-indent: 0pt;text-align: center;">挂科补考费用补偿</p>
            </td>
            <td style="width:104pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                colspan="2">
                <p class="s4" style="padding-left: 13pt;text-indent: 0pt;text-align: left;">科目一（最高4次）</p>
            </td>
            <td style="width:77pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                rowspan="4">
                <p style="text-indent: 0pt;text-align: left;"><br /></p>
                <p class="s4" style="padding-left: 25pt;text-indent: 0pt;text-align: left;">1500元</p>
            </td>
            <td style="width:57pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                rowspan="5">
                <p style="text-indent: 0pt;text-align: left;"><br /></p>
                <p class="s4" style="text-indent: 0pt;text-align: center;">
                    不超过3年，具体以
                    实际培训合同时间为准</p>
            </td>
            <td style="width:213pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                colspan="2" rowspan="4">
                <p style="text-indent: 0pt;text-align: left;"><br /></p>
                <p class="s4"
                   style="text-indent: 0pt;line-height: 26pt;text-align: center;">
                    赔付驾考学员每科最高4次考试补偿费用，按照每次实际补考费用补偿。</p>
            </td>
        </tr>
        <tr style="height:17pt">
            <td style="width:104pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                colspan="2">
                <p class="s4" style="padding-top: 1pt;padding-left: 13pt;text-indent: 0pt;text-align: left;">
                    科目二（最高4次）</p>
            </td>
        </tr>
        <tr style="height:17pt">
            <td style="width:104pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                colspan="2">
                <p class="s4" style="padding-top: 1pt;padding-left: 13pt;text-indent: 0pt;text-align: left;">
                    科目三（最高4次）</p>
            </td>
        </tr>
        <tr style="height:18pt">
            <td style="width:104pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                colspan="2">
                <p class="s4" style="padding-top: 1pt;padding-left: 13pt;text-indent: 0pt;text-align: left;">
                    科目四（最高4次）</p>
            </td>
        </tr>
        <tr style="height:51pt">
            <td style="width:185pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                colspan="3">
                <p style="text-indent: 0pt;text-align: left;"><br /></p>
                <p class="s4" style="padding-left: 43pt;text-indent: 0pt;text-align: left;">驾驶员重新报名费用补偿最高</p>
            </td>
            <td
                    style="width:77pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt">
                <p style="text-indent: 0pt;text-align: left;"><br /></p>
                <p class="s4" style="text-indent: 0pt;text-align: center;">5000.00元</p>
            </td>
            <td style="width:213pt;border-top-style:solid;border-top-width:1pt;border-left-style:solid;border-left-width:1pt;border-bottom-style:solid;border-bottom-width:1pt;border-right-style:solid;border-right-width:1pt"
                colspan="2">
                <p class="s4" style="padding-top: 1pt;padding-right: 4pt;text-indent: 0pt;text-align: justify;">
                    科目二或科目三累计不合格5次导致成绩取消，赔偿培训最后没有通过需要重新学习的费用，以重新培训的实际费用为准，最高补偿不超过5000元。</p>
            </td>
        </tr>
    </table>
    <p style="text-indent: 0pt;text-align: left;"><br /></p>
    <p style="padding-top: 2pt;padding-left: 5pt;text-indent: 0pt;text-align: left;">争议处理方式： ■ 诉讼 □ 仲裁</p>
    <p style="text-indent: 0pt;text-align: left;"><br /></p>
    <p style="text-indent: 0pt;text-align: center;">特别约定： 驾考通过，保险责任终止。重学保障最高5000元，重考保障1500元。</p>
    <p style="padding-left: 5pt;text-indent: 0pt;text-align: left;">
        1.本保险同一被保险人只可投保一次，适用于首次申领C1和C2两类机动车驾驶证的学员。</p>
    <p style="padding-left: 5pt;text-indent: 0pt;text-align: left;">
    2.本保单需在科目二考试前七天投保，理赔金额以当地交管局或车管所官方公布数据为准；本保单保障科目一至科目四的补考及重学责任，每科目补考费至多理赔4
    次；理赔金额以当地交管局或车管所官方公布数据为准。
    </p>
    <p class="s5" style="padding-left: 5pt;text-indent: 0pt;text-align: left;">3. <span
            class="p">本保单不保障因考生缺考造成的补考损失。若科目一或科目四当次考试成绩为0，则判断为缺考；由于因缺考造成的重学，缺考五次不予赔付；</span>
    </p>
    <p class="s5" style="padding-left: 5pt;text-indent: 0pt;line-height: 12pt;text-align: left;">4. <span
            class="p">驾驶人单科补考费用补偿保险适用于被保险人单科考试不通过，累计赔偿限额以保单约定为准；</span>
    </p>
    <p class="s5" style="padding-left: 5pt;text-indent: 0pt;text-align: left;">5. <span
            class="p">被保险人在科目连续五次不过的情况下，被交通主管部门认定需要重新报考学习的，可获重新报名学习的费用补偿，以实际报名费用为准，最高不超过保单约定限额。</span>
    </p>
    <p style="text-indent: 0pt;text-align: left;"><br /></p>
    <p style="font-size: 10.5pt;padding-left: 5pt;text-indent: 0pt;text-align: left;"><a href="http://www.ccic-net.com.cn/" class="a"
                                                                       target="_blank">全国服务热线：95590 网址：</a><a href="http://www.ccic-net.com.cn/"
                                                                                                              target="_blank">http://www.ccic-net.com.cn/</a></p>
    <p style="font-size: 10.5pt;padding-left: 5pt;text-indent: 0pt;text-align: left;"><a
            href="http://www.ccic-net.com.cn/)%E6%9F%A5%E8%AF%A2%E4%BF%9D%E9%99%A9%E5%8D%95%E4%BF%A1%E6%81%AF.%E5%A6%82%E6%9E%9C"
            class="a" target="_blank">您可通过全国服务热线或两天后通过我公司网站(http://www.ccic-net.com.cn/)查询保险单信息.</a>如果出险请及时拨打报案。</p>
    <div id="Footer">
        <br>
        <hr> <br><a href="#top" id="aTop" class="aTop">需要导出为PDF</a>
    </div>
</div>

<script type="text/javascript" src="js/html2canvas.js"></script>
<script type="text/javascript" src="js/jsPdf.debug.js"></script>
<script>
    var downPdf = document.getElementById("renderPdf");
    downPdf.onclick = function () {
        renderPdf.style.display="none";
        aTop.style.display="none";
        // Footer = document.getElementById("Footer");
        // document.getElementsByClassName('content')[0].removeChild(Footer);
        html2canvas(document.body, {
            onrendered: function (canvas) {

                var contentWidth = canvas.width;
                var contentHeight = canvas.height;

                //一页pdf显示html页面生成的canvas高度;
                // var pageHeight = contentWidth / 592.28 * 841.89;
                var pageHeight = contentWidth / 592.28 * 841.89;
                //未生成pdf的html页面高度
                var leftHeight = contentHeight;
                //pdf页面偏移
                var position = 0;
                //a4纸的尺寸[595.28,841.89]，html页面生成的canvas在pdf中图片的宽高
                var paperSize = 595.28;
                var imgWidth = paperSize;
                var imgHeight = paperSize / contentWidth * contentHeight;
                var pageData = canvas.toDataURL('image/jpeg', 1.0);

                var pdf = new jsPDF('', 'pt', 'a4');

                //有两个高度需要区分，一个是html页面的实际高度，和生成pdf的页面高度(841.89)
                //当内容未超过pdf一页显示的范围，无需分页
                if (leftHeight<pageHeight) {
                    pdf.addImage(pageData, 'JPEG', 0, 0, imgWidth, imgHeight);
                } else {
                    while (leftHeight > 0) {
                        pdf.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight);
                        leftHeight -= pageHeight;
                        position -= 841.89;

                        //避免添加空白页
                        if (leftHeight > 0) {
                            pdf.addPage();
                        }
                    }
                }
                pdf.save("${user.name}_${user.policyid}" + ".pdf");
            }
        })
    }
</script>
</body>

</html>